<%--
  Created by IntelliJ IDEA.
  User: liu'teng
  Date: 2021/10/12
  Time: 1:00
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户信息</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="http://code.jquery.com/jquery-2.0.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style>
        th,td{
            text-align: center;
        }
    </style>
    <script>
        function delUser(id){
            if(confirm("您确定删除吗？")){
                location.href="${pageContext.request.contextPath}/deluserservlet?id="+id;
            }
        }
    </script>
</head>
<body>
<div  class="container">
   <div align="center"><h1>用户信息列表</h1></div>
    <div style="float: left;margin: 5px">
        <form class="form-inline">
            <div class="form-group">
                <label for="exampleInputName2">姓名</label>
                <input type="text" class="form-control" id="exampleInputName2" placeholder="请输入姓名">
            </div>
            <div class="form-group">
                <label for="exampleInputcountry">籍贯</label>
                <input type="email" class="form-control" id="exampleInputcountry" placeholder="请输入地址">
            </div>
            <div class="form-group">
                <label for="exampleInputEmail2">邮箱</label>
                <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
            </div>
            <button type="submit" class="btn btn-default">查询</button>
        </form>
    </div>
    <div style="float: right;margin: 5px">
        <a class="btn btn-primary" href="${pageContext.request.contextPath}/addUser.jsp">添加联系人</a>
        <a class="btn btn-primary">删除选中</a>
    </div>
    <table border="1" class="table table-bordered table-hover" align="center">
        <tr class="success">
            <th><input type="checkbox"></th>
            <th>编号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>籍贯</th>
            <th>QQ</th>
            <th>邮箱</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${requestScope.users}" var="user" varStatus="number">
            <tr>
                <td><input type="checkbox"></td>
                <td>${number.count}</td>
                <td>${user.name}</td>
                <td>${user.gender}</td>
                <td>${user.age}</td>
                <td>${user.address}</td>
                <td>${user.qq}</td>
                <td>${user.email}</td>
                <td><a class="btn btn-default btn-sm">修改</a>
                    <a class="btn btn-default btn-sm" href="javascript:delUser(${user.id})">删除</a></td>
            </tr>
        </c:forEach>
    </table>
    <div style="float: left">
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li>
                    <a href="#" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li>
                    <a href="#" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
    </div>
    <div style="float: left;margin-left: 10px;margin-top: 30px">共35条数据，共9页</div>
</div>
</body>
</html>
